<?php
require_once("AsteriskManager/config.php");
include("AsteriskManager/sesvars.php");
if(isset($_SESSION['QSTATS']['hideloggedoff'])) {
    $ocultar=$_SESSION['QSTATS']['hideloggedoff'];
} else {
    $ocultar="false";
}
?>


<head>
<style type="text/css">
.download {

	background:linear-gradient(to bottom, #599bb3 5%, #408c99 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#599bb3', endColorstr='#408c99',GradientType=0);
	background-color:#599bb3;
	-moz-border-radius:8px;
	-webkit-border-radius:8px;
	border-radius:8px;
	display:inline-block;
	cursor:pointer;
	color:#ffffff;
	font-family:arial;
	font-size:14px;
	
	text-decoration:none;
	text-shadow:0px 1px 0px #3d768a;
}
.myButton:hover {
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #408c99), color-stop(1, #599bb3));
	background:-moz-linear-gradient(top, #408c99 5%, #599bb3 100%);
	background:-webkit-linear-gradient(top, #408c99 5%, #599bb3 100%);
	background:-o-linear-gradient(top, #408c99 5%, #599bb3 100%);
	background:-ms-linear-gradient(top, #408c99 5%, #599bb3 100%);
	background:linear-gradient(to bottom, #408c99 5%, #599bb3 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#408c99', endColorstr='#599bb3',GradientType=0);
	background-color:#408c99;
}
.myButton:active {
	position:relative;
	top:1px;
}
.hidden{
	display: none;
}
td #imgreen:parent { background: green !important; }
#box-table-b
{
	font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
	font-size: 12px;
	text-align: center;
	border-collapse: collapse;
	border-top: 7px solid #9baff1;
	border-bottom: 7px solid #9baff1;
}
#box-table-b th
{
	font-size: 13px;
	font-weight: normal;
	padding: 8px;
	background: #e8edff;
	border-right: 1px solid #9baff1;
	border-left: 1px solid #9baff1;
	color: #039;
}
#box-table-b td
{
	padding: 8px;
	background: #e8edff; 
	border-right: 1px solid #aabcfe;
	border-left: 1px solid #aabcfe;
	color: #669;
}
</style>
<script type="text/javascript">
		var aJaxURL		= "server-side/call/incomming.action.php";		//server side folder url
		var aJaxURL1	= "server-side/call/incomming.action1.php";
		var aJaxURL2	= "server-side/call/incomming.action2.php";
		var aJaxURL3	= "server-side/call/incomming.action3.php";
		var aJaxURL4	= "server-side/call/incomming.action4.php";
		var seoyURL		= "server-side/seoy/seoy.action.php";
		var upJaxURL	= "server-side/upload/file.action.php";	
		var wsdl_url    = "includes/classes/wsdl.class.php";
		var tName	= "example";										//table name
		var fName	= "add-edit-form";
		var tbName		= "tabs";										//form name
		var file_name = '';
		var rand_file = '';

		$(document).ready(function () {

			runAjax();
			GetTabs(tbName); 
			GetTable0();

			

			/* Add Button ID, Delete Button ID */
			//GetButtons("add_button", "","");
			//SetEvents("add_button", "", "", tName, fName, aJaxURL);

		});
		$(document).on("tabsactivate", "#tabs", function() {
        	var tab = GetSelectedTab(tbName);
        	if (tab == 0) {
        		GetTable0();
         	}else if(tab == 1){
            	GetTable1();
            }
         	else if(tab == 2){
          		GetTable2();
          	}
        	else if(tab == 3){
              	GetTable3();
            }
        	else{
            	GetTable4();
            }
        });
		
		function GetTable0() {
            LoadTable();
            GetButtons("add_button", "","");			
			SetEvents("add_button", "", "", "example", fName, aJaxURL);			
        }
        function GetTable1() {
        	GetDate("search_start_my");
			 GetDate("search_end_my");
        	var start = $("#search_start_my").val();
			var end = $("#search_end_my").val();
             LoadTable1(start,end);
             
             SetEvents("", "", "", "example1", fName, aJaxURL1);
         }
         function GetTable2() {
             LoadTable2();
             SetEvents("", "", "", "example2", fName, aJaxURL2);
         }
		 function GetTable3() {
			 GetDate("search_start");
			 GetDate("search_end");
			 var start = $("#search_start").val();
				var end = $("#search_end").val();
             LoadTable3(start,end);
             
             SetEvents("", "", "", "example3", fName, aJaxURL3);
         }
		 function GetTable4() {
             LoadTable4();
             SetEvents("", "", "", "example4", fName, aJaxURL4);
         }

		 function LoadTable(){
				/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
				GetDataTable("example", aJaxURL, "get_list", 12, "", 0, "", 1, "desc");
			}
		function LoadTable1(start, end){
			var start = $("#search_start_my").val();
			var end = $("#search_end_my").val();
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			
			GetDataTable("example1", aJaxURL1, "get_list", 12, "start=" + start + "&end=" + end, 0, "", 1, "desc");
			}
		function LoadTable2(){
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable("example2", aJaxURL2, "get_list", 12, "", 0, "", 1, "desc");
			}
		function LoadTable3(start, end){			
			var start = $("#search_start").val();
			var end = $("#search_end").val();
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable("example3", aJaxURL3, "get_list", 13, "start=" + start + "&end=" + end, 0, "", 1, "desc");
			}
		function LoadTable4(){
			/* Table ID, aJaxURL, Action, Colum Number, Custom Request, Hidden Colum, Menu Array */
			GetDataTable("example4", aJaxURL4, "get_list", 12, "", 0, "", 1, "desc");
			}

		$(document).on("change", "#search_start", function () {
	    	var start	= $(this).val();
	    	var end		= $("#search_end").val();
	    	LoadTable3(start, end);
	    });
	    
	    $(document).on("change", "#search_end", function () {
	    	var start	= $("#search_start").val();
	    	var end		= $(this).val();
	    	LoadTable3(start, end);
	    });

	    $(document).on("change", "#search_start_my", function () {
	    	var start	= $(this).val();
	    	var end		= $("#search_end_my").val();
	    	LoadTable1(start, end);
	    });
	    
	    $(document).on("change", "#search_end_my", function () {
	    	var start	= $("#search_start_my").val();
	    	var end		= $(this).val();
	    	LoadTable1(start, end);
	    });
		
		function LoadDialog(){
			/* Dialog Form Selector Name, Buttons Array */
			GetDialog(fName, 1060, "auto", "");
			
			var id = $("#incomming_id").val();
			var cat_id = $("#category_parent_id").val();

			$("#choose_button").button({
	            
	        });
			

			if(id != '' && cat_id == 407){
				$("#additional").removeClass('hidden');
			}

			GetDateTimes("call_problem_date");
			 $(document).on("click", "#button_calls", function () {
				 LoadDialogCalls();
				 $('#refresh-dialog').click(); });
			$( ".calls" ).button({
			      icons: {
			        primary: " ui-icon-contact"
			      }
			});
			legal();
		}

		$(document).on("click", ".download", function () {
            var link = ($(this).attr("str"));
      //      alert(link)
            link = 'http://10.0.18.18:8080/records/' + link;

            window.open(link, 'chatwindow', "width=420,height=230,resizable=yes,scrollbars=yes,status=yes");
            
        });
		
		function CloseDialog(){
			$("#" + fName).dialog("close");
		}

	    // Add - Save
	    $(document).on("click", "#save-dialog", function () {
		    $("#save-dialog").attr("disabled", true);
		    param 			= new Object();

		    param.act						= "save_incomming";

		    // Incomming Param
	    	param.id						= $("#id").val();
	    	param.call_date					= $("#call_date").val();
	    	param.call_phone				= $("#call_phone").val();
	    	param.category_parent_id		= $("#category_parent_id").val();
	    	param.category_id				= $("#category_id").val();
	    	param.sub_category				= $("#sub_category").val();
	    	param.call_problem_date			= $("#call_problem_date").val();
	    	param.call_status_id			= $("#call_status_id").val();
	    	param.call_object_id		    = $("#call_object_id").val();
	    	param.call_source_id			= $("#call_source_id").val();
	    	param.call_content				= $("#call_content").val();

	    	// Task Param
	    	param.task_department_id		= $("#task_department_id").val();
	    	param.task_type_id				= $("#task_type_id").val();
	    	param.priority_id				= $("#priority_id").val();
	    	param.persons_id				= $("#persons_id").val();

	    	// Person Info Param
	    	param.abonent_phone				    = $("#abonent_phone").val();
	    	param.abonent_pin				    = $("#abonent_pin").val();
	    	param.abonent_name					= $("#abonent_name").val();
	    	param.abonent_responsibl_person		= $("#abonent_responsibl_person").val();
	    	param.abonent_address				= $("#abonent_address").val();
	    	param.abonent_number				= $("#abonent_number").val();
	    	param.abonent_status				= $("input[name='legal']:checked").val();
	    	param.abonent_coment				= $("#abonent_coment").val();
	    	if($("input[name='undone_id']").is(':checked')){
	    		param.undone_id				        = 1;
	    	}else{
	    		param.undone_id				        = 0;
	    	}
	    	// File Param
	    	param.rand_file					= rand_file;
	    	param.file_name					= file_name;
	    	param.hidden_inc				= $("#hidden_inc").val();
	    	param.hidden_checker			= $("#hidden_checker").val();
	    	
	    	
			if(param.call_phone == ""){
				alert("შეავსეთ ტელეფონის ნომერი!");
			}else {
			    $.ajax({
			        url: aJaxURL,
				    data: param,
			        success: function(data) {
						if(typeof(data.error) != 'undefined'){
							if(data.error != ''){
								alert(data.error);
							}else{
								 LoadTable();
								 LoadTable1();
								 LoadTable2();
								 LoadTable3();
								 LoadTable4();
				        		 CloseDialog();
							}
						}
				    }
			    });
			}
		});

	    function run(number){

	    	param 			= new Object();
		 	param.act		= "get_add_page";
		 	param.number	= number;

	    	$.ajax({
		        url: aJaxURL,
			    data: param,
		        success: function(data) {
					if(typeof(data.error) != 'undefined'){
						if(data.error != ''){
							alert(data.error);
						}else{
							$("#add-edit-form").html(data.page);
							LoadDialog();
						}
					}
			    }
		    });
		    }

	    $(document).on("click", "#download", function () {
	    	var download_file	= $(this).val();
	    	var download_name 	= $('#download_name').val();
	    	SaveToDisk(download_file, download_name);
	    });

	    function SaveToDisk(fileURL, fileName) {
	        // for non-IE
	        if (!window.ActiveXObject) {
	            var save = document.createElement('a');
	            save.href = fileURL;
	            save.target = '_blank';
	            save.download = fileName || 'unknown';

	            var event = document.createEvent('Event');
	            event.initEvent('click', true, true);
	            save.dispatchEvent(event);
	            (window.URL || window.webkitURL).revokeObjectURL(save.href);
	        }
		     // for IE
	        else if ( !! window.ActiveXObject && document.execCommand)     {
	            var _window = window.open(fileURL, "_blank");
	            _window.document.close();
	            _window.document.execCommand('SaveAs', true, fileName || fileURL)
	            _window.close();
	        }
	    } 
	    
	    $(document).on("click", "#delete", function () {
	    	var delete_id	= $(this).val();
	    	var r = confirm("გსურთ წაშალოთ?");
	    	if (r == true) {
	    		$.ajax({
			        url: aJaxURL,
				    data: {
						act: "delete_file",
						delete_id: delete_id,
						edit_id: $("#id").val(),
					},
			        success: function(data) {
				        $("#file_div").html(data.page);
				    }
	    		
			    });
	    	}	
		});
		
	    $(document).on("click", "#choose_button", function () {
		    $("#choose_file").click();
		});
		
	    $(document).on("change", "#choose_file", function () {
	    	var file		= $(this).val();	    
	    	var files 		= this.files[0];
		    var name		= uniqid();
		    var path		= "../../media/uploads/file/";
		    
		    var ext = file.split('.').pop().toLowerCase();
	        if($.inArray(ext, ['pdf','png','xls','xlsx','jpg']) == -1) { //echeck file type
	        	alert('This is not an allowed file type.');
                this.value = '';
	        }else{
	        	file_name = files.name;
	        	rand_file = name + "." + ext;
	        	$.ajaxFileUpload({
	    			url: upJaxURL,
	    			secureuri: false,
	    			fileElementId: "choose_file",
	    			dataType: 'json',
	    			data:{
						act: "upload_file",
						path: path,
						file_name: name,
						type: ext
					},
	    			success: function (data, status){
	    				if(typeof(data.error) != 'undefined'){
    						if(data.error != ''){
    							alert(data.error);
    						}
    					}
    							
	    				$.ajax({
					        url: aJaxURL,
						    data: {
								act: "up_now",
								rand_file: rand_file,
					    		file_name: file_name,
								edit_id: $("#id").val(),

							},
					        success: function(data) {
						        $("#file_div").html(data.page);
						    }
					    });	   					    				
    				},
    				error: function (data, status, e)
    				{
    					alert(e);
    				}    				
    			});
	        }
		});

	    function runAjax() {
            $.ajax({
            	async: true,
            	dataType: "html",
		        url: 'AsteriskManager/liveState.php',
			    data: 'sesvar=hideloggedoff&value=true',
		        success: function(data) {
							$("#jq").html(data);
			    }
            }).done(function(data) {
                setTimeout(runAjax, 1000);
            });
        }

	    $(document).on("click", ".number", function () {
	    	var number = $(this).attr("number");
	    	if(number != ""){
	    		run(number);
	    		console.log(number);
		    }
	    });

	    $(document).on("click", ".insert", function () {
	    	var phone = $(this).attr("number");
	    	console.log(phone);
	    	if(phone != ""){
	    		$('#call_phone').val(phone);
		    }
	    });


	   
//------------------------------------------------------------------------------------------------------     
    	$(document).on("change", "#category_parent_id",function(){
     	 	param 			= new Object();
 		 	param.act		= "sub_category";
 		 	param.cat_id   	= this.value;
 		 	$.getJSON(aJaxURL, param ,function(data){
				if(data.error != ''){
					alert(data.error);
				}else{					
					$("#category_id").html(data.cat);
					$("#sub_category").html("");
				}
 		 	    });
        });

    	$(document).on("change", "#category_id",function(){
     	 	param 			= new Object();
 		 	param.act		= "sub_category1"; 		 	
 		 	param.cat_id   	= this.value;
 		 	console.log(param);
 		 	$.getJSON(aJaxURL, param ,function(data){
				if(data.error != ''){
					alert(data.error);
				}else{					
					$("#sub_category").html(data.cat);
				}
 		 	    });
        });
    	$(document).on("change", "#task_department_id",function(){
     	 	param 			= new Object();
 		 	param.act		= "task_department"; 		 	
 		 	param.cat_id   	= this.value;
 		 	console.log(param);
 		 	$.getJSON(aJaxURL, param ,function(data){
				if(data.error != ''){
					alert(data.error);
				}else{					
					$("#persons_id").html(data.cat);
				}
 		 	    });
        });
    	
 //-----------------------------------------------------------------------------------------       
   	 
	    $(document).on("click", "#refresh-dialog", function () {
    	 	param 			= new Object();
		 	param.act		= "get_calls";

	    	$.ajax({
		        url: aJaxURL,
			    data: param,
		        success: function(data) {
					if(typeof(data.error) != 'undefined'){
						if(data.error != ''){
							alert(data.error);
						}else{
							$("#last_calls").html(data.calls);
							$( ".insert" ).button({
							      icons: {
							        primary: "ui-icon-plus"
							      }
							});
						}
					}
			    }
		    });

	    });

	

	    function LoadDialogCalls(){
			var button = {
               		"save": {
               			text: "განახლება",
               			id: "refresh-dialog",
               			click: function () {
               			}
               		}
				};

			/* Dialog Form Selector Name, Buttons Array */
			GetDialogCalls('last_calls', 330, 550, button);
		}
	    function legal(){
	    	$(".Jural").hide();
	    	$(".fhisical").hide();
	    	$("."+$("input[name=legal]:checked").val()).show();
		}

	    function check_undone(){
    	    if($("input[name='check_done']").is(':checked')){
    	    	GetDataTable("example", aJaxURL, "get_list&check_undone=1", 12, "", 0, "", 1, "desc");
        	}else{
        		GetDataTable("example", aJaxURL, "get_list&check_undone=0", 12, "", 0, "", 1, "desc");
        	}
	    }
    </script>
</head>

<body>

<table style="width: 100%; margin: 1 0 0 100px; padding-top:25px; display: block; ">
		<tr>
			<td style="width: 70%;">
<div id="tabs" style="width: 99%; margin: 0 auto; min-height: 768px; margin-top: 25px;">
		<ul>
			<li><a href="#tab-0">ჩემი ზარები დღეს</a></li>
			<li><a href="#tab-1">ჩემი ზარები</a></li>
			<li><a href="#tab-2">ზარები დღეს</a></li>
			<li><a href="#tab-3">ყველა ზარი</a></li>
		</ul>
		<div id="tab-0">
			<div id="container" style="width: 100%;">        	
		       <div id="dynamic">
		       <h2 align="center">შემომავალი ზარები</h2>
            	<div id="button_area">            	   
        			<button id="add_button" style="float: left;">დამატება</button>
        			<span style="float: left; display: block; margin: 5px;">
        			<label for="check_done" style="margin-top: 5px;">დაუსრულებელი</label>
        			<input type="checkbox" id="check_done" name="check_done" onclick="check_undone()"/>
        			</span>
        		</div>
        		
                <table class="display" id="example" style="width: 100%;">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width:  50%">თარიღი</th>
                            <th style="width:  50%">ტელეფონი</th>
                            <th style="width:  50%">კატეგორია</th>
                            <th style="width:  50%">ზარის ტიპი</th>
                            <th style="width:  50%">ქვე-კატეგოტია</th>
                            <th style="width:  50%">ბიზნეს ცენტრი</th>   
                            <th style="width:  50%">შინაარსი</th>                         
                            <th style="width:  50%">ავტორი</th>                                     
                            <th style="width:  50%;display: none;">s</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" style="width:80px;"></th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width:80px;"/>
                            </th>
                            <th>
                                <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 80px;"/>
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width:80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th class="colum_hidden">
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            <div class="spacer">
	              </div>
	                </div>
	         </div>
	          </div>
		<div id="tab-1">
			<div id="container" style="width: 100%;">        	
		       <div id="dynamic">
		       <h2 align="center">შემომავალი ზარები</h2>
		       <div id="button_area" style="margin-top: 0px;">
	            	<div class="left" style="width: 250px;">
	            		<label for="search_start_my" class="left" style="margin: 5px 0 0 9px;">დასაწყისი</label>
	            		<input style="width: 100px; margin-left: 5px; height: 18px;" type="text" name="search_start_my" id="search_start_my" class="inpt left"/>
	            	</div>
	            	<div class="right" style="">
	            		<label for="search_end_my" class="left" style="margin: 5px 0 0 9px;">დასასრული</label>
	            		<input style="width: 100px; margin-left: 5px; height: 18px;" type="text" name="search_end_my" id="search_end_my" class="inpt right" />
            		</div>	
            	</div>
            	<table class="display" id="example1" style="width: 100%;">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width:  50%">თარიღი</th>
                            <th style="width:  50%">ტელეფონი</th>
                            <th style="width:  50%">კატეგორია</th>
                            <th style="width:  50%">ზარის ტიპი</th>
                            <th style="width:  50%">ქვე-კატეგოტია</th>
                            <th style="width:  50%">ბიზნეს ცენტრი</th>   
                            <th style="width:  50%">შინაარსი</th>
                            <th style="width:  50%">ავტორი</th>
                            <th style="width:  50%;display: none;">s</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" style="width:80px;"></th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width:80px;"/>
                            </th>
                            <th>
                                <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 80px;"/>
                            </th>
                          
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width:80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th class="colum_hidden">
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            <div class="spacer">
	              </div>
	                </div>
	         </div>
	          </div>
	     
	          <div id="tab-2">
			<div id="container" style="width: 100%;">        	
		       <div id="dynamic">
		       <h2 align="center">შემომავალი ზარები</h2>
            	<table class="display" id="example2" style="width: 100%;">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width:  50%">თარიღი</th>
                            <th style="width:  50%">ტელეფონი</th>
                            <th style="width:  50%">კატეგორია</th>
                            <th style="width:  50%">ზარის ტიპი</th>
                            <th style="width:  50%">ქვე-კატეგოტია</th>
                            <th style="width:  50%">ბიზნეს ცენტრი</th>   
                            <th style="width:  50%">შინაარსი</th>                         
                            <th style="width:  50%">ავტორი</th>
                            <th style="width:  50%;display: none;">s</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" style="width:80px;"></th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width:80px;"/>
                            </th>
                            <th>
                                <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 80px;"/>
                            </th>                          
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width:80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th class="colum_hidden">
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            <div class="spacer">
	              </div>
	                </div>
	         </div>
	          </div>
	          <div id="tab-3">
			<div id="container" style="width: 100%;">        	
		       <div id="dynamic">
		       <h2 align="center">შემომავალი ზარები</h2>
		       <div id="button_area" style="margin-top: 0px;">
	            	<div class="left" style="width: 250px;">
	            		<label for="search_start" class="left" style="margin: 5px 0 0 9px;">დასაწყისი</label>
	            		<input style="width: 100px; margin-left: 5px; height: 18px;" type="text" name="search_start" id="search_start" class="inpt left"/>
	            	</div>
	            	<div class="left" style="">
	            		<label for="search_end" class="left" style="margin: 5px 0 0 9px;">დასასრული</label>
	            		<input style="width: 100px; margin-left: 5px; height: 18px;" type="text" name="search_end" id="search_end" class="inpt right" />
            		</div>
            	</div>
            	<table class="display" id="example3" style="width: 100%;">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width:  50%">თარიღი</th>
                            <th style="width:  50%">ტელეფონი</th>
                            <th style="width:  50%">კატეგორია</th>
                            <th style="width:  50%">ზარის ტიპი</th>
                            <th style="width:  50%">ქვე-კატეგოტია</th>
                            <th style="width:  50%">ბიზნეს ცენტრი</th>
                            <th style="width:  50%">შინაარსი</th>
                            <th style="width:  50%">ავტორი</th>
                            <th style="width:  50%">აბონენტის ნომერი</th>
                            <th style="width:  50%;display: none;">s</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" style=""/>
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" style="width:80px;"></th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" style="width:80px;"/>
                            </th>
                            <th>
                                <input type="text" name="search_phone" value="ფილტრი" class="search_init" style="width: 80px;"/>
                            </th>                          
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width:80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                             <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th>
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                            <th class="colum_hidden">
                                <input type="text" name="search_category" value="ფილტრი" class="search_init" style="width: 80px;" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            <div class="spacer">
	              </div>
	                </div>
	         </div>
	          </div>
	          
	      </div>
	       
	    <td style="width: 0px;">
		   &nbsp;
		</td>
		<td style="width: 30%;">
		   <div id="jq" style=""></div>
		</td>
	</tr>
</table>

    <!-- jQuery Dialog -->
    <div  id="add-edit-form" class="form-dialog" title="შემომავალი ზარი">
	</div>

	<!-- jQuery Dialog -->
	<div id="last_calls" title="ბოლო ზარები">
	</div>
</body>
